<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Job Search</title>
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.2.0/css/bootstrap.min.css">
<style type="text/css">
table {
	width: 650px;
}
table td{
	background-color: #FFFFFF;
	padding: 10px;
}
#header {
	height: 60px;
	background: #00DDDD;
	font-size: 30pt;
	font-weight:bold;
}
#header1 {
	background: #00DDDD;
}

#header2 {
	height: 60px;
	background: #00DDDD;
	font-size: 10pt;
	font-weight:bold;
}

#repswspan {
	color: #000000;
	margin-left: 110px;
	font-size: 12pt;
	font-weight:bold;
}

.errorinfo {
	color: #FF0000;
	display: none;
	font-size: 10pt;
}

.information {
	color: #0000FF;
	font-size: 10pt;
}

#information1 {
	color: #000000;
	font-size: 12pt;
	font-weight: bold;
}

</style>

<script type="text/javascript">
	function createRequest(url) {
		http_request = false;
		if (window.XMLHttpRequest) {
			http_request = new XMLHttpRequest();
		} else if (window.ActiveXObject) {
			try {
				http_request = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					http_request = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {
				}
			}
		}
		if (!http_request) {
			return false;
		}
		http_request.onreadystatechange = getResult;
		http_request.open('GET', url, true);
		http_request.send(null);
	}
	function getResult() {
		if (http_request.readyState == 4) {
			if (http_request.status == 200) {
				var divNode= document.getElementById("employerUsernamediv3");
				if (http_request.responseText==9) {
					divNode.style.display = "block";
					return false;
				} else {
					divNode.style.display = "none";
					return true;
				}
			}
		}
	}
	function checkemployer(employerUsername) {
		createRequest('CheckUserRegisted?user=' + employerUsername.value);
	}

	function checkemployerUsername(employerUsernameNode) {
		var value = employerUsernameNode.value;
		var divNode1 = document.getElementById("employerUsernamediv1");
		if (value != "") {
			divNode1.style.display = "none";
			var regex = /^[A-Z]\w{2,7}$/;
			var divNode2 = document.getElementById("employerUsernamediv2");
			if (regex.test(value)) {
				divNode2.style.display = "none";
				return true;
			} else {
				divNode2.style.display = "block";
				return false;
			}
		} else {
			divNode1.style.display = "block";
			return false;
		}

	}
	function checkname(nameNode) {
		var value = nameNode.value;
		var divNode1 = document.getElementById("namediv1");
		if (value != "") {
			divNode1.style.display = "none";
			var regex = /^\w{3,8}$/;
			var divNode2 = document.getElementById("namediv2");
			if (regex.test(value)) {
				divNode2.style.display = "none";
				return true;
			} else {
				divNode2.style.display = "block";
				return false;
			}
		} else {
			divNode1.style.display = "block";
			return false;
		}

	}
	function checkpsw(pswNode) {
		var value = pswNode.value;
		var divNode1 = document.getElementById("pswdiv1");
		if (value != "") {
			divNode1.style.display = "none";
			var regex = /^[a-z0-9]{3,6}$/;
			var divNode2 = document.getElementById("pswdiv2");
			if (regex.test(value)) {
				divNode2.style.display = "none";
				return true;
			} else {
				divNode2.style.display = "block";
				return false;
			}
		} else {
			divNode1.style.display = "block";
			return false;
		}

	}

	function checkrepsw(repswNode) {
		var value1 = repswNode.value;
		var value2 = document.getElementsByName("psw")[0].value;
		var divNode = document.getElementById("repswdiv");
		if (value1 == value2) {
			divNode.style.display = "none";
			return true;
		} else {
			divNode.style.display = "block";
			return false;
		}
	}

	function checkaddress(addressNode) {
		var value3 = addressNode.value;
		var divNode = document.getElementById("addressdiv");
		if (value3 != "") {
			divNode.style.display = "none";
			return true;
		} else {
			divNode.style.display = "block";
			return false;
		}
	}

	function checkphoneNumber2(phoneNumber2Node) {
		var value = phoneNumber2Node.value;
		var divNode1 = document.getElementById("phoneNumberdiv1");
		if (value != "") {
			divNode1.style.display = "none";
			var regex = /^1[3|4|5|8][0-9]\d{8}$/;
			var divNode3 = document.getElementById("phoneNumberdiv3");
			if (regex.test(value)) {
				divNode3.style.display = "none";
				return true;
			} else {
				divNode3.style.display = "block";
				return false;
			}
		} else {
			divNode1.style.display = "block";
			return false;
		}
	}

	function checkMail(mailNode) {
		var value = mailNode.value;
		var divNode1 = document.getElementById("maildiv1");
		if (value != "") {
			divNode1.style.display = "none";
			var regex = /^\w+@\w+(\.\w+)+$/;
			var divNode3 = document.getElementById("maildiv2");
			if (regex.test(value)) {
				divNode3.style.display = "none";
				return true;
			} else {
				divNode3.style.display = "block";
				return false;
			}
		} else {
			divNode1.style.display = "block";
			return false;
		}
	}

	function checkintroduction(introductionNode) {
		var value7 = introductionNode.value;
		var divNode = document.getElementById("introductiondiv");
		if (value7 != "") {
			divNode.style.display = "none";
			return true;
		} else {
			divNode.style.display = "block";
			return false;
		}
	}

	function check(form) {
		with (form) {
			if (getResult() && checkemployerUsername(employerUsername)
					&& checkname(name) && checkpsw(psw) && checkrepsw(repsw)
					&& checkaddress(address) && checkphoneNumber2(phoneNumber2)
					&& checkMail(mail)) {
				return true;
			} else {
				alert("This information is not all true!");
				return false;
			}
		}
	}
</script>
</head>
<body>
	<div id="header" align="center"><font color="000099">Employer&nbsp;&nbsp;&nbsp;&nbsp;Register</font></div>
	<div id="header1" align="center">
	<form action="RegisteER" method="post"
		onsubmit="return check(this);">
		<table align="center">
			<tr>
				<td>
					<div id="information1">EmployerUsername</div>
					<div>
						<input class="form-control"  placeholder="eg:Dipen" type="text" name="employerUsername"
							onblur="checkemployerUsername(this);checkemployer(this)" />
					</div>
					<div class="errorinfo" id="employerUsernamediv1">The
						EmployerUsername information is empty!</div>
					<div class="errorinfo" id="employerUsernamediv2">The
						EmployerUsername format is not reasonable!</div>
					<div class="errorinfo" id="employerUsernamediv3">The EmployerUsername is used!</div>
					<div class="information">Your EmployerUsername must be
						between 3 and 8 characters long and the first is capital!</div>
				</td>
			</tr>
			<tr>
				<td>
					<div id="information1">Name</div>
					<div>
						<input class="form-control"  placeholder="eg:Dipen" type="text" name="name" onblur="checkname(this)" />
					</div>
					<div class="errorinfo" id="namediv1">The Name information is
						empty!</div>
					<div class="errorinfo" id="namediv2">The Name format is not
						reasonable!</div>
					<div class="information">Your name must be between 3 and 8
						characters long!</div>
				</td>
			</tr>
			<tr>
				<td>
					<div>
						<span id="information1">Password</span><span id="repswspan">Password again</span>
					</div>
					<div class="form-inline">
						<input class="form-control" type="password" name="psw" onblur="checkpsw(this)" placeholder="eg:123456"/> <input
							class="form-control" type="password" name="repsw" onblur="checkrepsw(this)" />
					</div>
					<div class="errorinfo" id="pswdiv1">The Password information
						is empty!</div>
					<div class="errorinfo" id="pswdiv2">The Password format is
						not reasonable!</div>
					<div class="errorinfo" id="repswdiv">Password is not equal!</div>
					<div class="information">Your Password must be between 3 and
						6 characters long!</div>
				</td>
			</tr>
			<tr>
				<td>
					<div id="information1">Address</div>
					<div>
						<input class="form-control" type="text" name="address" onblur="checkaddress(this)" placeholder="eg:China.JiangSu.WuXi" />
					</div>
					<div class="errorinfo" id="addressdiv">The Address
						information is empty!</div>
				</td>
			</tr>
			<tr>
				<td>
					<div id="information1">Phonenumber</div>
					<div class="form-inline">
						<select class="form-control" name="phoneNumber1" size="1">
							<option>Afghanistan (+93)</option>
							<option>Albania (+355)</option>
							<option>Algeria (+213)</option>
							<option>American Samoa (+1)</option>
							<option>Andorra (+376)</option>
							<option>Angola (+244)</option>
							<option>Anguilla (+1)</option>
							<option>Antarctica (+672)</option>
							<option>Antigua, Barbuda (+1268)</option>
							<option>Argentina (+54)</option>
							<option>Armenia (+374)</option>
							<option>Aruba (+297)</option>
							<option>Ascension (+247)</option>
							<option>Australia (+61)</option>
							<option>Austria (+43)</option>
							<option>Azerbaidijan (+994)</option>
							<option>Bahamas (+1)</option>
							<option>Bahrain (+973)</option>
							<option>Bangladesh (+880)</option>
							<option>Barbados (+1)</option>
							<option>Belarus (+375)</option>
							<option>Belgium (+32)</option>
							<option>Belize (+501)</option>
							<option>Benin (+229)</option>
							<option>Bermuda (+1441)</option>
							<option>Bhutan (+975)</option>
							<option>Bolivia (+591)</option>
							<option>Bosnia / Herzegovina(+387)</option>
							<option>Botswana (+267)</option>
							<option>Brazil (+55)</option>
							<option>British Virgin Islands (+1)</option>
							<option>Brunei Darussalam (+673)</option>
							<option>Bulgaria (+359)</option>
							<option>Burkina Faso (+226)</option>
							<option>Burundi (+257)</option>
							<option>Cambodia (+855)</option>
							<option>Cameroon (+237)</option>
							<option>Canada (+1)</option>
							<option>Cape Verde (+238)</option>
							<option>Cayman Islands (+1345)</option>
							<option>Central African Republic (+236)</option>
							<option>Chad (+235)</option>
							<option>Chile (+56)</option>
							<option>China (+86)</option>
							<option>Colombia (+57)</option>
							<option>Comoros (+269)</option>
							<option>Cook Islands (+682)</option>
							<option>Costa Rica (+506)</option>
							<option>Croatia (+385)</option>
							<option>Cyprus (+357)</option>
							<option>Czech Republic (+420)</option>
							<option>Denmark (+45)</option>
							<option>Diego Garcia (+246)</option>
							<option>Djibouti (+253)</option>
							<option>Dominica (+1)</option>
							<option>Dominican Republic (+1)</option>
							<option>East Timor (+670)</option>
							<option>Ecuador (+593)</option>
							<option>Egypt (+20)</option>
							<option>El Salvador (+503)</option>
							<option>Equatorial Guinea (+240)</option>
							<option>Eritrea (+291)</option>
							<option>Estonia (+372)</option>
							<option>Ethiopia (+251)</option>
							<option>Falklands Islands (+500)</option>
							<option>Faroe Islands (+298)</option>
							<option>Fiji Islands (+679)</option>
							<option>Finland (+358)</option>
							<option>France (+33)</option>
							<option>French Dept/Terr in Indian Ocean (+262)</option>
							<option>French Guiana (+594)</option>
							<option>French Polynesia (+689)</option>
							<option>Gabon (+241)</option>
							<option>Gambia (+220)</option>
							<option>Georgia (+995)</option>
							<option>Germany (+49)</option>
							<option>Ghana (+233)</option>
							<option>Gibraltar (+350)</option>
							<option>Greece (+30)</option>
							<option>Greenland (+299)</option>
							<option>Grenada (+1473)</option>
							<option>Guadeloupe (+590)</option>
							<option>Guam (+1)</option>
							<option>Guatemala (+502)</option>
							<option>Guinea (+224)</option>
							<option>Guinea-Bissau (+245)</option>
							<option>Guyana (+592)</option>
							<option>Haiti (+509)</option>
							<option>Honduras (+504)</option>
							<option>Hong Kong (+852)</option>
							<option>Hungary (+36)</option>
							<option>Iceland (+354)</option>
							<option>India (+91)</option>
							<option>Indonesia (+62)</option>
							<option>Iran (+98)</option>
							<option>Iraq (+964)</option>
							<option>Ireland (+353)</option>
							<option>Israel (+972)</option>
							<option>Italy (+39)</option>
							<option>Jamaica (+1876)</option>
							<option>Japan (+81)</option>
							<option>Jordan (+962)</option>
							<option>Kenya (+254)</option>
							<option>Kiribati (+686)</option>
							<option>Kuwait (+965)</option>
							<option>Kyrgyzstan (+996)</option>
							<option>Lao (+856)</option>
							<option>Latvia (+371)</option>
							<option>Lebanon (+961)</option>
							<option>Lesotho (+266)</option>
							<option>Liberia (+231)</option>
							<option>Liechtenstein (+423)</option>
							<option>Lithuania (+370)</option>
							<option>Luxembourg (+352)</option>
							<option>Macao (+853)</option>
							<option>Macedonia (+389)</option>
							<option>Madagascar (+261)</option>
							<option>Malawi (+265)</option>
							<option>Malaysia (+60)</option>
							<option>Maldives (+960)</option>
							<option>Mali (+223)</option>
							<option>Malta (+356)</option>
							<option>Marshall Islands (+692)</option>
							<option>Martinique (+596)</option>
							<option>Mauritania (+222)</option>
							<option>Mauritius (+230)</option>
							<option>Mexico (+52)</option>
							<option>Micronesia (+691)</option>
							<option>Moldova (+373)</option>
							<option>Monaco (+377)</option>
							<option>Mongolia (+976)</option>
							<option>Montenegro (+382)</option>
							<option>Montserrat (+1664)</option>
							<option>Morocco (+212)</option>
							<option>Mozambique (+258)</option>
							<option>Namibia (+264)</option>
							<option>Nauru (+674)</option>
							<option>Nepal (+977)</option>
							<option>Netherlands (+31)</option>
							<option>Netherlands Antilles (+599)</option>
							<option>New Caledonia (+687)</option>
							<option>New Zealand (+64)</option>
							<option>Nicaragua (+505)</option>
							<option>Niger (+227)</option>
							<option>Nigeria (+234)</option>
							<option>Niue (+683)</option>
							<option>Northern Mariana Islands (+1)</option>
							<option>Norway (+47)</option>
							<option>Oman (+968)</option>
							<option>Pakistan (+92)</option>
							<option>Palau (+680)</option>
							<option>Panama (+507)</option>
							<option>Papua New Guinea (+675)</option>
							<option>Paraguay (+595)</option>
							<option>Peru (+51)</option>
							<option>Philippines (+63)</option>
							<option>Poland (+48)</option>
							<option>Portugal (+351)</option>
							<option>Puerto-Rico (+1)</option>
							<option>Qatar (+974)</option>
							<option>Reunion (+262)</option>
							<option>Romania (+40)</option>
							<option>Russia (+7)</option>
							<option>Rwanda (+250)</option>
							<option>Saint Helena (+290)</option>
							<option>Saint Kitts and Nevis (+1)</option>
							<option>Saint Lucia (+1758)</option>
							<option>Saint Pierre and Miquelon (+508)</option>
							<option>Saint Vincent and the Grenadines (+1)</option>
							<option>Samoa (+685)</option>
							<option>San Marino (+378)</option>
							<option>Sao Tome and Principe (+239)</option>
							<option>Saudi Arabia (+966)</option>
							<option>Senegal (+221)</option>
							<option>Serbia (+381)</option>
							<option>Seychelles (+248)</option>
							<option>Sierra Leone (+232)</option>
							<option>Singapore (+65)</option>
							<option>Slovakia (+421)</option>
							<option>Slovenia (+386)</option>
							<option>Solomon Islands (+677)</option>
							<option>South Africa (+27)</option>
							<option>South Korea (+82)</option>
							<option>Spain (+34)</option>
							<option>Sri Lanka (+94)</option>
							<option>Suriname (+597)</option>
							<option>Swaziland (+268)</option>
							<option>Sweden (+46)</option>
							<option>Switzerland (+41)</option>
							<option>Taiwan (+886)</option>
							<option>Tajikistan (+992)</option>
							<option>Tanzania (+255)</option>
							<option>Thailand (+66)</option>
							<option>Togo (+228)</option>
							<option>Tokelau (+690)</option>
							<option>Tonga (+676)</option>
							<option>Trinidad, Tobago (+1868)</option>
							<option>Tunisia (+216)</option>
							<option>Turkey (+90)</option>
							<option>Turkmenistan (+993)</option>
							<option>Turks and Caicos (+1649)</option>
							<option>Tuvalu (+688)</option>
							<option>Uganda (+256)</option>
							<option>Ukraine (+380)</option>
							<option>United Arab Emirates (+971)</option>
							<option>United Kingdom (+44)</option>
							<option>United States (+1)</option>
							<option>Uruguay (+598)</option>
							<option>US Virgin Islands (+1)</option>
							<option>Uzbekistan (+998)</option>
							<option>Vanuatu (+678)</option>
							<option>Vatican City State (+39)</option>
							<option>Venezuela (+58)</option>
							<option>Vietnam (+84)</option>
							<option>Wallis and Futuna (+681)</option>
							<option>Yemen (+967)</option>
							<option>Zambia (+260)</option>
							<option>Zimbabwe (+263)</option>
						</select> <input class="form-control" type="text" name="phoneNumber2"
							onblur="checkphoneNumber2(this)" placeholder="eg:13698569856"/>
					</div>
					<div class="errorinfo" id="phoneNumberdiv1">The Phonenumber
						information is empty!</div>
					<div class="errorinfo" id="phoneNumberdiv3">The Phonenumber
						format is not reasonable!</div>
					<div class="information">Your Phonenumber must be 11 numbers long!</div>
				</td>
			</tr>
			<tr>
				<td>
					<div id="information1">E-mail</div>
					<div>
						<input class="form-control" type="text" name="mail" onblur="checkMail(this)" placeholder="eg:Dipen@yahoo.com"/>
					</div>
					<div class="errorinfo" id="maildiv1">The E-mail information
						is empty!</div>
					<div class="errorinfo" id="maildiv2">The E-mail format is not
						reasonable!</div>
				</td>
			</tr>
			<tr>
				<td align="center">
				<input class="btn btn-primary" type="submit" value="Submit">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input class="btn btn-primary" type="reset" value="Reset">
				</td>
			</tr>
		</table>
	</form>
	</div>
	<div id="header" align="center"><font color="000099">Java2-6&nbsp;&nbsp;&nbsp;&nbsp;JobSearch</font></div>
</body>
</html>